<!DOCTYPE html>
<html lang="zh">
	<head>
		<meta charset="utf-8" />
		<base href="../../../" />
		<script src="page.js"></script>
		<link type="text/css" rel="stylesheet" href="page.css" />
	</head>
	<body>
		<h1>[name]</h1>

		<p class="desc">
			[link:https://webglfundamentals.org/webgl/lessons/webgl-render-to-texture.html render target]是一个缓冲，就是在这个缓冲中，视频卡为正在后台渲染的场景绘制像素。
			它用于不同的效果，例如用于在一个图像显示在屏幕上之前先做一些处理。

		</p>


		<h2>构造器</h2>


		<h3>[name]([param:Number width], [param:Number height], [param:Object options])</h3>

		<p>
		[page:Float width] -renderTarget的宽度. Default is `1`.<br />
		[page:Float height] - renderTarget的高度. Default is `1`.<br />
		options - (可选)一个保存着自动生成的目标纹理的纹理参数以及表示是否使用深度缓存/模板缓存的布尔值的对象
		以下是一些合法选项：<br /><br />

		[page:Constant wrapS] - 默认是[page:Textures ClampToEdgeWrapping]. <br />
		[page:Constant wrapT] - 默认是[page:Textures ClampToEdgeWrapping]. <br />
		[page:Constant magFilter] - 默认是[page:Textures LinearFilter]. <br />
		[page:Constant minFilter] - 默认是[page:Textures LinearFilter]. <br />
		[page:Boolean generateMipmaps] - 默认是`false`.<br />
		[page:Constant format] - 默认是[page:Textures RGBAFormat]. <br />
		[page:Constant type] - 默认是[page:Textures UnsignedByteType]. <br />
		[page:Number anisotropy] - 默认是`1`. 参见[page:Texture.anisotropy]<br />
		[page:Constant colorSpace] - 默认是[page:Textures NoColorSpace]. <br />
		[page:String internalFormat] -  默认是 `null`.<br />
		[page:Boolean depthBuffer] - 默认是`true`.<br />
		[page:Boolean stencilBuffer] - 默认是`false`.<br />
		[page:Boolean resolveDepthBuffer] - 默认是`true`.<br />
		[page:Boolean resolveStencilBuffer] - 默认是`true`.<br />
		[page:Number samples] - 默认是`0`.<br />
		[page:Number count] - default is `1`.<br /><br />

		创建一个新[name]
		</p>

		<h2>属性</h2>

		<h3>[property:Boolean isWebGLRenderTarget]</h3>
		<p>
			Read-only flag to check if a given object is of type [name].
		</p>

		<h3>[property:number width]</h3>
		<p>
		渲染目标宽度
		</p>

		<h3>[property:number height]</h3>
		<p>
		渲染目标高度
		</p>

		<h3>[property:Vector4 scissor]</h3>
		<p>
		渲染目标视口内的一个矩形区域，区域之外的片元将会被丢弃
		</p>

		<h3>[property:Boolean scissorTest]</h3>
		<p>
		表明是否激活了剪裁测试
		</p>

		<h3>[property:Vector4 viewport]</h3>
		<p>
		渲染目标的视口
		</p>

		<h3>[property:Texture texture]</h3>
		<p>
		纹理实例保存这渲染的像素，用作进一步处理的输入值
		</p>

		<h3>[property:Texture textures]</h3>
		<p>
			An array holding the [page:WebGLRenderTarget.texture texture] references
			of multiple render targets configured with the [page:Number count] option.
		</p>

		<h3>[property:Boolean depthBuffer]</h3>
		<p>
		渲染到深度缓冲区。默认true.
		</p>

		<h3>[property:Boolean stencilBuffer]</h3>
		<p>
		渲染到模板缓冲区。默认为false.
		</p>

		<h3>[property:Boolean resolveDepthBuffer]</h3>
		<p>
			Defines whether the depth buffer should be resolved when rendering into a multisampled render target. 
			默认为`true`.
		</p>

		<h3>[property:Boolean resolveStencilBuffer]</h3>
		<p>
			Defines whether the stencil buffer should be resolved when rendering into a multisampled render target. 
			This property has no effect when [page:.resolveDepthBuffer] is set to `false`. 
			默认为`true`.
		</p>

		<h3>[property:DepthTexture depthTexture]</h3>
		<p>
		如果设置，那么场景的深度将会被渲染到此纹理上。默认为null
		</p>

		<h3>[property:Number samples]</h3>
		<p>
		Defines the count of MSAA samples. Default is *0*.
		</p>

		<h2>方法</h2>

		<h3>[method:null setSize]( [param:Number width], [param:Number height] )</h3>
		<p>
		设置渲染目标的大小
		</p>

		<h3>[method:WebGLRenderTarget clone]()</h3>
		<p>
		创建一个渲染目标副本
		</p>

		<h3>[method:this copy]( [param:WebGLRenderTarget source] )</h3>
		<p>
		采用传入的渲染目标的设置
		</p>

		<h3>[method:null dispose]()</h3>
		<p>
		发出一个处理事件
		</p>
		<h3>[page:EventDispatcher EventDispatcher]方法可从此类中获得</h3>

		<h2>源码</h2>

		<p>
			[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
		</p>
	</body>
</html>
